// ------------------------------------
// constants
// ------------------------------------
export const ARTICLE_INCREMENT = 'ARTICLE_INCREMENT'
export const ARTICLE_DECREMENT = 'ARTICLE_DECREMENT'

// ------------------------------------
// Actions
// ------------------------------------
export function increment(){
    return {
        type: ARTICLE_INCREMENT
    }
}

export function decrement(){
    return {
        type: ARTICLE_DECREMENT
    }
}

// ------------------------------------
// reducers
// ------------------------------------
const initial = 0
export default function counter(state = initial, action) {
    switch (action.type){
        case ARTICLE_INCREMENT:
            return state + 1
        case ARTICLE_DECREMENT:
            return state - 1
        default:
            return state
    }
}
